package com.huatech.domain;

import java.util.Date;

import javax.validation.constraints.Email;

import org.hibernate.validator.constraints.Length;
import org.springframework.format.annotation.DateTimeFormat;

import com.fasterxml.jackson.annotation.JsonFormat;

public class User {
	
	private Long id;
	
	// 日期类型输出到页面格式  
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")    
    // 页面字符串格式化为日期  
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")  
	private Date createTime;
    @Length(min = 2, max = 10, message = "用户名长度在{min}到{max}之间")
	private String username;
    
	@JsonFormat(pattern="yyyy-MM-dd",timezone = "GMT+8")    
	@DateTimeFormat(pattern="yyyy-MM-dd")  
	private Date birthday;
	
    @Email(message = "邮箱格式错误")
	private String email;
	private String remark;
	
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public Date getCreateTime() {
		return createTime;
	}
	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}
	public String getUsername() {
		return username;
	}
	public void setUsername(String username) {
		this.username = username;
	}
	
	public Date getBirthday() {
		return birthday;
	}
	public void setBirthday(Date birthday) {
		this.birthday = birthday;
	}
	public String getEmail() {
		return email;
	}
	public void setEmail(String email) {
		this.email = email;
	}
	public String getRemark() {
		return remark;
	}
	public void setRemark(String remark) {
		this.remark = remark;
	}
	
	@Override
	public String toString() {
		return "User [id=" + id + ", createTime=" + createTime + ", username=" + username + ", email=" + email
				+ ", remark=" + remark + "]";
	}
	
}
